package com.xjm.entity.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xjm.constant.Update;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.Date;

@TableName("classify")
@Data
public class ClassifyModel {
    @NotNull(message = "id不能为空", groups = {Update.class})
    private Integer id;
    @NotBlank(message = "分类名称不能为空")
    private String name;
    @NotBlank(message = "分类图片链接不能为空")
    private String url;
    @NotBlank(message = "分类状态不能为空")
    private Integer status;

    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private Date createdTime;

    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @TableField(fill = FieldFill.UPDATE)
    private Date updatedTime;
}
